package painel;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.EventQueue;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.*;

import javax.swing.*; 


import javax.swing.JFrame;

public class LoginPainel {

	private JFrame frmCentral;
	private JLabel lblLogin;
	private JTextField textLogin;
	private JLabel lblSenha;
	private JPasswordField passwordSenha;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) 
	{
		EventQueue.invokeLater(new Runnable()
		{
			public void run() 
			{
				try 
				{
					LoginPainel window = new LoginPainel();
					window.frmCentral.setVisible(true);
				} 
				catch (Exception e) 
				{
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public LoginPainel() 
	{
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() 
	{
		frmCentral = new JFrame();
		frmCentral.getContentPane().setBackground(new Color(255, 255, 255));
		frmCentral.setBackground(new Color(245, 222, 179));
	//	frmCentral.setIconImage(Toolkit.getDefaultToolkit().getImage("e:\\Eclipse-Atualizado\\Agenda\\Agenda\\src\\Figuras\\aviao1.gif"));
		frmCentral.setTitle("SRPA - Sistema de Reservas de Passagens A\u00E9reas");
		frmCentral.setBounds(100, 100, 988, 484);
		frmCentral.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frmCentral.getContentPane().setLayout(null);
		
		JPanel panel_Central = new JPanel();
		panel_Central.setBackground(new Color(255, 255, 255));
		panel_Central.setBounds(0, 11, 980, 450);
		frmCentral.getContentPane().add(panel_Central);
		panel_Central.setLayout(null);
		
		lblLogin = new JLabel("Login");
		lblLogin.setBounds(411, 14, 69, 14);
		panel_Central.add(lblLogin);
		lblLogin.setForeground(Color.BLUE);
		lblLogin.setFont(new Font("Candara", Font.BOLD | Font.ITALIC, 15));
		lblLogin.setHorizontalAlignment(SwingConstants.CENTER);
		
		textLogin = new JTextField();
		textLogin.setBounds(471, 11, 155, 20);
		panel_Central.add(textLogin);
		textLogin.setForeground(Color.BLUE);
		textLogin.setFont(new Font("Candara", Font.BOLD | Font.ITALIC, 15));
		textLogin.setHorizontalAlignment(SwingConstants.LEFT);
		textLogin.setColumns(10);
		
		lblSenha = new JLabel("Senha");
		lblSenha.setBounds(627, 14, 56, 14);
		panel_Central.add(lblSenha);
		lblSenha.setForeground(Color.BLUE);
		lblSenha.setFont(new Font("Candara", Font.BOLD | Font.ITALIC, 15));
		lblSenha.setHorizontalAlignment(SwingConstants.CENTER);
		
		passwordSenha = new JPasswordField();
		passwordSenha.setBounds(693, 11, 182, 20);
		panel_Central.add(passwordSenha);
		passwordSenha.setForeground(Color.BLUE);
		passwordSenha.setFont(new Font("Candara", Font.BOLD | Font.ITALIC, 15));
		passwordSenha.setHorizontalAlignment(SwingConstants.LEFT);
		
		JLabel lblSlogan = new JLabel("Verde Linhas A\u00E9reas - Trabalhando para o seu conforto!!!!");
		lblSlogan.setForeground(new Color(0, 128, 128));
		lblSlogan.setHorizontalAlignment(SwingConstants.CENTER);
		lblSlogan.setFont(new Font("Candara", Font.BOLD | Font.ITALIC, 40));
		lblSlogan.setBounds(10, 52, 987, 33);
		panel_Central.add(lblSlogan);
		
		JLabel lblImagem = new JLabel("");
		lblImagem.setHorizontalAlignment(SwingConstants.LEFT);
		//lblImagem.setIcon(new ImageIcon(LoginPainel.class.getResource("/imagens/aviao.gif")));
		lblImagem.setFont(new Font("Candara", Font.BOLD | Font.ITALIC, 18));
		lblImagem.setForeground(new Color(0, 128, 128));
		lblImagem.setBounds(10, 14, 100, 27);
		panel_Central.add(lblImagem);
		
		JLabel lblBemVindo = new JLabel("Voe com a melhor !!!");
		lblBemVindo.setForeground(new Color(0, 128, 128));
		lblBemVindo.setHorizontalAlignment(SwingConstants.CENTER);
		lblBemVindo.setFont(new Font("Cambria", Font.BOLD | Font.ITALIC, 20));
		lblBemVindo.setBounds(131, 5, 270, 27);
		panel_Central.add(lblBemVindo);
		
		JButton btnOK = new JButton("");
		btnOK.addActionListener(new ActionListener() {
			@SuppressWarnings("deprecation")
			public void actionPerformed(ActionEvent arg0) 
			{
				frmTelaPrincipal telaprincipal = new frmTelaPrincipal();
				telaprincipal.show();
				
			}
		});
		btnOK.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		//btnOK.setIcon(new ImageIcon(LoginPainel.class.getResource("/imagens/botao_ok.gif")));
		btnOK.setBounds(881, 10, 42, 23);
		panel_Central.add(btnOK);
	}
	private static void addPopup(Component component, final JPopupMenu popup) {
		component.addMouseListener(new MouseAdapter() {
			public void mousePressed(MouseEvent e) {
				if (e.isPopupTrigger()) {
					showMenu(e);
				}
			}
			public void mouseReleased(MouseEvent e) {
				if (e.isPopupTrigger()) {
					showMenu(e);
				}
			}
			private void showMenu(MouseEvent e) {
				popup.show(e.getComponent(), e.getX(), e.getY());
			}
		});
	}
}
